package org.example.utils;

public class CurrentHolder {
    private static final ThreadLocal<Integer> CURRENT_LOCAL = new ThreadLocal<>();
    public  static void setCurrentId(Integer EmpId)
    {
        CURRENT_LOCAL.set(EmpId);//设置当前线程局部变量
    }
    public static Integer getCurrentId()
    {
        return CURRENT_LOCAL.get();//获取当前线程局部变量
    }


    public static void remove() {
        CURRENT_LOCAL.remove();//移除当前线程局部变量
    }
}
